﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DataVisit.Factory;

namespace DataVisit.Handler.View.SecurityMarket
{
    public class EverydayRisksView : AbstractView
    {
        public void GetReport()
        {
            var year = JsonRequest.GetParam<string>("year");
            var month = JsonRequest.GetParam<string>("month");
            JsonResponse.ResponseObject = DaoFactory.SecurityMarketDao.GetEverydayRisks(DateTime.Parse(year + "-" + month + "-01"));
        }

        public void GetCheckDepartments()
        {
            var year = JsonRequest.GetParam<string>("year");
            var month = JsonRequest.GetParam<string>("month");
            JsonResponse.ResponseObject = DaoFactory.SecurityMarketDao.GetCheckDepartments(DateTime.Parse(year + "-" + month + "-01"));
        }

        public void GetHazardTypes()
        {
            var year = JsonRequest.GetParam<string>("year");
            var month = JsonRequest.GetParam<string>("month");
            JsonResponse.ResponseObject = DaoFactory.SecurityMarketDao.GetHazardTypes(DateTime.Parse(year + "-" + month + "-01"));
        }

        public void GetLocations()
        {
            var year = JsonRequest.GetParam<string>("year");
            var month = JsonRequest.GetParam<string>("month");
            JsonResponse.ResponseObject = DaoFactory.SecurityMarketDao.GetLocations(DateTime.Parse(year + "-" + month + "-01"));
        }

        public void GetHazardLevel()
        {
            var year = JsonRequest.GetParam<string>("year");
            var month = JsonRequest.GetParam<string>("month");
            JsonResponse.ResponseObject = DaoFactory.SecurityMarketDao.GetHazardLevel(DateTime.Parse(year + "-" + month + "-01"));
        }
    }
}
